<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // window.onload = function (){
        //     alert("欢迎光临我的小店");
        // }
        // window.onbeforeunload=function (event){
        //     var e = event || window.event;
        //     e.returnValue="记得下次再来";
        // }
        
        window.onload = function (){
            alert("欢迎光临萌萌小店");
        }
        window.onload = function(event){
            var e = event || window.event;
            e.returnValue ="你真的想要离开吗？";
        }
    </script>
</head>
<body>
    jhjhjhjh

 
</body>
</html>